<template>
  <div class="page-container">
    <iframe :src="url" style="width: 100%; height: 100vh" v-if="url"></iframe>
  </div>
</template>

<script setup name="HrhcCar">
  import { getHrhcToken } from '@/api/asset/equipment'
  import { ref } from 'vue'
  // import { useRouter } from 'vue-router'
  // const router = useRouter()
  const url = ref('')
  const init = () => {
    getHrhcToken().then((res) => {
      // const item = router.currentRoute.value.params.item
      if (res.code === 200) {
        const env = import.meta.env.VITE_ENV
        if (env == 'test' || env == 'dev') {
          url.value = `https://test.yudao.hrhaoche.com${'/vehicle/publish/vue/carManage/handlingETC/installed?fullScreen=1'}&token=${
            res.result.hrhcToken
          }`
        } else {
          url.value = `https://a.hrhaoche.com${'/vehicle/publish/vue/carManage/handlingETC/installed?fullScreen=1'}&token=${
            res.result.hrhcToken
          }`
        }
        console.log('url', url.value)
      }
    })
  }
  init()
</script>

<style lang="less" scoped></style>
